package com.gohi.main.user.service;

import java.util.List;

import org.hibernate.TransactionException;

import com.gohi.main.system.hbm.ShopgooArea;
import com.gohi.main.system.hbm.ShopgooWxBrand;
import com.gohi.main.user.hbm.ShopgooMember;
import com.gohi.main.user.hbm.ShopgooMessage;


public interface IUserService {
	/**
	 * 用户登录
	 * @param username 用户名
	 * @param userpass  用户密码
	 * @return
	 * @throws TransactionException
	 */
	public abstract ShopgooMember Login(String username,String userpass)throws TransactionException;
	
	/**
	 * 根据ID获取一个用户信息
	 * @param id
	 * @return
	 * @throws TransactionException
	 */
	public abstract ShopgooMember getById(String id)throws TransactionException;
	
	/**
	 * 根据用户获取一个账号信息
	 * @param id
	 * @return
	 * @throws TransactionException
	 */
	public abstract ShopgooMember getByUserName(String username)throws TransactionException;
	
	/**
	 * 根据用户名字查询用户是否存在
	 * @param name
	 * @return  0 表示没有  大于1表示用户存在
	 * @throws TransactionException
	 */
	public abstract int getByNames(String name)throws TransactionException;
	
	/**
	 * 用户注册  
	 * @param user   用户对象
	 * @return 0注册失败 1注册成功
	 * @throws TransactionException
	 */
	public abstract int regMember(ShopgooMember user)throws TransactionException;
	/**
	 * 添加一个短信
	 * @param msg
	 * @return
	 * @throws TransactionException
	 */
	public abstract int addMessage(ShopgooMessage msg)throws TransactionException;
	/**
	 * 根据一个手机号码查询最后一个
	 * @param phone
	 * @return
	 * @throws TransactionException
	 */
	public abstract ShopgooMessage queryMessage(String phone)throws TransactionException;
	
	/**
	 * 根据KRY 更新一个字段的值
	 * @param key  键
	 * @param value  值
	 * @param id   主键ID
	 * @return
	 * @throws TransactionException
	 */
	public abstract int updateKey(String key ,String value ,String id)throws TransactionException;
	/**
	 * 判断手机号码是否已经注册了
	 * @param phone
	 * @return
	 * @throws TransactionException
	 */
	public abstract int checkPhoneReg(String phone)throws TransactionException;
}
